package com.mhkj.base.fruitType.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mhkj.base.fruitType.entity.FruitType;
import com.mhkj.base.fruitType.service.FruitTypeService;
import com.mics.core.common.componet.JsonHandler;
import com.mics.core.common.componet.Pagination;
import com.mics.core.system.base.controller.BaseController;

/**
 * 成果类别
 * @author mics
 * @date 2018年8月9日
 * @version 1.0
 */
@Controller
@RequestMapping("/fruitType")
public class FruitTypeController extends BaseController<FruitType>{	
	@Resource
	private FruitTypeService fruitTypeService;
	@Resource
	private JsonHandler jsonHandler;
	
	@RequestMapping("/listByPage")
	@ResponseBody
	public void listByPage(HttpServletResponse response,FruitType fruitType,int pageIndex,int pageSize){
		Pagination<FruitType> fPagination = fruitTypeService.listByPage(fruitType,pageIndex,pageSize);
		jsonHandler.sendJsonString(response, true, "获取数据成功！", fPagination, new String[]{"id","planTemplete.name","name","businessType.typeName","nodeResult.nodeName","nodePrepare.nodeName"},
				"id","planTmepleteName","name","busiMode","nodeResult","nodePrepare");
	}
}
